'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
      '/api-cloud-manage': {
        // target: 'http://172.20.1.3:88/api-cloud-manage',
        target: 'http://10.217.220.27:88/api-cloud-manage/',
        changeOrigin: true,
        pathRewrite: {
          '^/api-cloud-manage': ''
        }
      },
      '/api-cloud-platform': {
        // target: 'http://172.20.1.3:86/api-cloud-platform',
        target: 'http://10.217.220.27:86/api-cloud-platform',
        changeOrigin: true,
        pathRewrite: {
          '^/api-cloud-platform': ''
        }
      },
      '/portal-web': {
        // target: 'http://172.20.1.3:86/portal-web',
        target: 'http://10.217.220.27:86/portal-web',
        changeOrigin: true,
        pathRewrite: {
          '^/portal-web': ''
        }
      },
      // 调试 执行
      '/api-external': {
        // target: 'http://172.20.1.3:86/api-external',
        target: 'http://10.217.220.27:86/api-external',
        changeOrigin: true,
        pathRewrite: {
          '^/api-external': ''
        }
      },
      // api 调试 执行
      '/api/zyfwpt': {
        // target: 'http://172.20.1.3:86/api-external',
        target: 'http://10.217.220.27:86/api/zyfwpt',
        changeOrigin: true,
        pathRewrite: {
          '^/api/zyfwpt': ''
        }
      },
      // 所属部门
      '/api/meunDept': {
        // target: 'http://172.20.1.3:86/api-external',
        target: 'http://172.30.2.13:86/api/meunDept',
        changeOrigin: true,
        pathRewrite: {
          '^/api/meunDept': ''
        }
      },
      // api 调试 执行
      '/api/portal': {
        // target: 'http://172.20.1.3:86/api-external',
        //  target: 'http://192.168.137.141:8090/api/portal',
        target: 'http://172.30.2.13:86/api/portal',
        changeOrigin: true,
        pathRewrite: {
          '^/api/portal': ''
        }
      },
      // 首页资产一张图数据接口
      '/ccessinfo': {
        // 部署接口
        // target: 'http://172.30.2.10:9700/ccessinfo',
        // 本地接口
        target: 'http://10.217.220.26:9700/ccessinfo',
        changeOrigin: true,
        pathRewrite: {
          '^/ccessinfo': ''
        }
      },
    },

    // Various Dev Server settings
    // host: '10.222.99.137', // can be overwritten by process.env.HOST
    port: 8082, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-


    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    cssSourceMap: true
  },

  build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    /**
     * Source Maps
     */

    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  },

}
